﻿@{
    ViewBag.Title = "Lugar";
    ViewBag.slide = "false";
    ViewBag.user = "private";
    ViewBag.perfil = Session["Codigodeperfil"];
}
@section menuLateral{
    <p>
        <br />
        <br />
    </p>
    <ul>
        <li>@Html.ActionLink("Proyecto", "Index", "Proyecto")</li>
        <li>@Html.ActionLink("Tipos de Lugar", "Index", "TipodeLugar")</li>
        <li>@Html.ActionLink("Lugar", "Index", "Lugar")</li>
        <li>@Html.ActionLink("Unidades de Medida", "Index", "UnidaddeMedida")</li>
        <li>@Html.ActionLink("Variable", "Index", "Variable")</li>
        <li>@Html.ActionLink("Rango de Cualidad", "Index", "RangodeCualidad")</li>
        <li>@Html.ActionLink("Equipo de Medicion", "Index", "EquipodeMedicion")</li>
        <li>@Html.ActionLink("Detalle de Equipo", "Index", "DetalledeEquipo")</li>
        <li>@Html.ActionLink("Tipos de Muestra", "Index", "TipodeMuestra")</li>
        <li>@Html.ActionLink("Muestra", "Index", "Muestra")</li>
    </ul>
}
@section equipoMedicion {
    @using (Html.BeginForm("UploadFile", "Lugar", FormMethod.Post, new { enctype = "multipart/form-data", id = "form1" }))
    {

        // escritura de tabla estandar
        <fieldset>
            <br />
            <p>@Html.ActionLink("Regresar", "Index")</p>
            <table id="tabla">
                <thead>
                    <tr>
                        <th colspan="4">
                            <div align="center">
                                GESTIONAR FOTOGRAFIA DE LUGAR</div>
                        </th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="3">
                            <div align="center">
                                Gestion de fotografia de lugar</div>
                        </td>
                    </tr>
                </tfoot>
                <tbody>
                    <tr>
                    </tr>
                    <tr>
                        <!---->
                        <td class="color7">
                            <label for="descripcion">
                                Fotografia:</label>
                        </td>
                        <td>
                            <input type="text" id="txtFileName" disabled="true" style="border: solid 1px; background-color: #FFFFFF;"
                                placeholder="(3 MB max)" />
                            <span id="spanButtonPlaceholder"></span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div>
                <div class="flash" id="fsUploadProgress">
                    <!-- This is where the file progress gets shown.  SWFUpload doesn't update the UI directly.
                    The Handlers (in handlers.js) process the upload events and make the UI updates -->
                </div>
                <input type="hidden" name="hidFileID" id="hidFileID" value="" />
                <!-- This is where the file ID is stored after SWFUpload uploads the file and gets the ID back from upload.php -->
                <div align="center">
                    <input type="submit" value="Subir" id="btnSubmit" /></div>
            </div>
        </fieldset>
    
    }
}
@section javascript{
    <script type="text/javascript" src="@Url.Content("~/swfupload/swfupload.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/Scripts_sicom/handlers.js")"></script>
    <script type="text/javascript">
        var swfu;
          @{
              string idlugar = ViewData["id"].ToString();
          }
        window.onload = function () {

            swfu = new SWFUpload({
                // Backend settings
                upload_url: "/Lugar/UploadFile?idlugar="+@idlugar,
                file_post_name: "hidFileID",

                // Flash file settings
                file_size_limit: "3 MB",
                file_types: "*.jpg;*.png;*.bmp;*.gif", 		// or you could use something like: "*.doc;*.wpd;*.pdf",
                file_types_description: "All Files",
                file_upload_limit: "0",
                file_queue_limit: "1",

                // Event handler settings
                swfupload_loaded_handler: swfUploadLoaded,

                file_dialog_start_handler: fileDialogStart,
                file_queued_handler: fileQueued,
                file_queue_error_handler: fileQueueError,
                file_dialog_complete_handler: fileDialogComplete,

                //upload_start_handler : uploadStart,	// I could do some client/JavaScript validation here, but I don't need to.
                upload_progress_handler: uploadProgress,
                upload_error_handler: uploadError,
                upload_success_handler: uploadSuccess,
                upload_complete_handler: uploadComplete,

                // Button Settings
                button_image_url: '@Url.Content("~/Content/img/XPButtonUploadText_61x22.png")',
                button_placeholder_id: "spanButtonPlaceholder",
                button_width: 61,
                button_height: 22,

                // Flash Settings
                flash_url: '@Url.Content("~/swfupload/swfupload.swf")',

                custom_settings: {
                    progress_target: "fsUploadProgress",
                    upload_successful:true
                },

                // Debug settings
                debug: false
            });

        };
    </script>
}
